import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true
      }
    },
    modules: {
      localsConvention: 'camelCase', // 使用驼峰命名法
      scopeBehaviour: 'local', // 模块化行为
      generateScopedName: '[name]_[local]_[hash:5]' // 自定义类名生成规则
    }
  }
});
